package aorise.com.frame.view;

import android.content.Context;
import android.graphics.Canvas;
import android.graphics.Paint;
import android.support.v7.widget.AppCompatEditText;
import android.util.AttributeSet;

import aorise.com.frame.R;

/**
 * @author zhangliwen
 * @date 2019/11/8.
 * 下划线的  输入框
 */
public class LineEditText extends AppCompatEditText {
    private Paint mPaint;


    public LineEditText(Context context, AttributeSet attrs) {
        super(context, attrs);
        // TODO Auto-generated constructor stub
        mPaint = new Paint();


        mPaint.setStyle(Paint.Style.STROKE);
        mPaint.setColor(context.getResources().getColor(R.color.AEAEAE));
        mPaint.setStrokeWidth(2);
    }


    @Override
    public void onDraw(Canvas canvas) {
        super.onDraw(canvas);


        //      画底线
        canvas.drawLine(0, this.getHeight() - 1, this.getWidth() - 1, this.getHeight() - 1, mPaint);
    }
}
